
#include "tslib.h"

int init_ts( int * ts_point)
{
	//1.打开触摸屏设备文件 ts_open
	struct tsdev *ts = ts_open("/dev/event0", 0);
	
	//2.配置ts_config
	int ret = ts_config(ts);  //如果ret == -1配置失败，0表示成功
	struct ts_sample smp;
	ret = ts_read(ts, &smp, 1);
	//装载读到的数据
	ts_point[0]=smp.x;
	ts_point[1]=smp.y;
	ts_point[2]=smp.pressure;
	//4.关闭设备文件ts_close
	ts_close(ts);	
	return 0;
}